package com.a01_2021.thousandstimes.exception;

/**
 * @Author E1xP@foxmail.com
 * @Version 1.0
 * @PACKAGE_NAME com.a01_2021.thousandstimes.utils
 * @CLASS_NAME CustomExceptionType
 * @Description TODO 自定义异常类型
 * @Date 2021/2/23 下午 9:23
 **/
public enum CustomExceptionType {
    USER_INPUT_ERROR(400, "用户输入异常"),
    POSITION_HAD_BEEN_SET_ERROR(400, "职位已存在"),
    ROLE_HAD_BEEN_SET_ERROR(400, "角色已存在"),
    MENU_HAD_BEEN_SET_ERROR(400, "权限已存在"),
    ROLE_IS_NOT_IDLE(400, "角色未闲置（仍被分配到用户"),
    MENU_NOT_IDLE(400, "权限未闲置（仍被分配到角色"),
    OPERATION_NOT_ALLOW(400, "非法操作"),
    NO_FILE_ERROR(400, "无对应上传文件"),
    FILE_FORM_ERROR(400, "文件格式不合法"),
    OFFWORK_HAD_BEEN_REQUEST_ERROR(400, "已有请假存在"),
    DIMISSION_NOT_FOUND_ERROR(404, "找不到该离职申请"),
    POST_NOT_FOUND_ERROE(404, "找不到该职位标签"),
    ABILITY_MODEL_NOT_FOUND(404, "找不到该能力模型"),
    EXPERIENCE_NOT_FOUND_ERROR(404, "找不到该经历"),
    VOTE_NOT_FOUND_ERROR(404, "找不到该评分"),
    LEARN_TODAY_NOT_FOUND_ERROR(404, "找不到该今日学"),
    PERSONNEL_INFORMATION_NOT_FOUND_ERROR(404, "找不到人事信息条目"),
    OFFWORK_NOT_FOUNT_ERROR(404, "找不到请假记录"),
    INTERPOLATE_NOT_FOUND_ERROR(404, "找不到内推"),
    NOTE_NOT_FOUND_ERROR(404, "找不到便签"),
    REPORT_NOT_FOUND_ERROR(404, "找不到报告"),
    WORKLOG_NOT_FOUND_ERROR(404, "找不到工作任务"),
    UNION_NOT_FOUND_ERROR(404, "找不到联盟"),
    ROLE_NOT_FOUNT_ERROR(404, "找不到角色"),
    MENU_NOT_FOUNT_ERROR(404, "找不到权限"),
    INSTANCE_NOT_FOUND_ERROR(404, "找不到实例"),
    USER_NOT_FOUND_ERROR(404, "找不到该用户"),
    AUTHENTICATION_NOT_FOUND(404, "找不到授权条目"),
    SYSTEM_ERROR(500, "系统服务异常"),
    OTHER_ERROR(999, "其他未知异常");

    private final String typeDesc;//异常类型中文描述
    private final int code; //code

    CustomExceptionType(int code, String typeDesc) {
        this.code = code;
        this.typeDesc = typeDesc;
    }

    public String getTypeDesc() {
        return typeDesc;
    }

    public int getCode() {
        return code;
    }
}
